package com.zwps.biz.domain.extra.rabbitmq.producer;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.zwps.biz.domain.extra.rabbitmq.define.FileDefine;
import com.zwps.biz.domain.extra.rabbitmq.message.PictureCompressMessage;
import com.zwps.biz.domain.extra.rabbitmq.message.VideoProcessMessage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FileProcessProducer {

 //   @Autowired(required = false)
 //   private RabbitTemplate rabbitTemplate;

    @Autowired
    private ObjectMapper objectMapper;

    /**
     * 发送图片压缩消息
     * 
     * @Title: sendPicturePorcessMessage
     * @Description:
     * @param message void
     * @author lyh
     * @date 2023年8月20日 下午7:05:22
     */
    public void sendPicturePorcessMessage(PictureCompressMessage message) {
     /*   if (rabbitTemplate == null) {
            return;
        }
        try {
            String body = objectMapper.writeValueAsString(message);
            CorrelationData correlationData = new CorrelationData();
            rabbitTemplate.convertAndSend(FileDefine.EXCHANGE, FileDefine.PICTURE_COMPRESS_ROUTE, body,
                    correlationData);
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }

    /**
     * 发送视频处理消息
     * 
     * @Title: sendVideoPorcessMessage
     * @Description:
     * @param message
     * @author lyh
     * @date 2023年10月26日 上午11:28:18
     */
    public void sendVideoPorcessMessage(VideoProcessMessage message) {
      /*  if (rabbitTemplate == null) {
            return;
        }
        try {
            String body = objectMapper.writeValueAsString(message);
            CorrelationData correlationData = new CorrelationData();
            rabbitTemplate.convertAndSend(FileDefine.EXCHANGE, FileDefine.VIDEO_PROCESS_ROUTE, body, correlationData);
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }
}
